package cn.lysj.framework.order.domain;

import cn.lysj.framework.base.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Transient;
import javax.transaction.Transactional;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @author zwj
 * @description 订单
 * @create 2018-11-05 09:51:42
 **/
@Data
@Entity
@EqualsAndHashCode(callSuper = true)
public class FoodOrder extends BaseEntity {

    private String eatTableId;//餐桌id
    private String storeId;//门店ID
    private String customerId;//客户Id
    private String foodOrderNumber;//订单编号
    @Column(columnDefinition = "decimal(10,2)")
    private BigDecimal sumMoney;//应付金额
    @Column(columnDefinition = "decimal(10,2)")
    private BigDecimal refundMoney;//退款金额
    private String foodOrderRemark;//订单备注
    private Integer serialNumber;// 餐桌编号
    private String eatTableName;//餐桌名称
    private Integer repastWay;//就餐方式 1.现吃 2.外带
    private Integer payWay;//支付方式 1.支付宝 2.微信
    private Integer foodOrderStatus;//订单状态 -2.预留订单 -1.线上未支付 1.已支付 2.已结单 3.申请退款 4.退款成功 5.退款失败 6.下单未支付,7.已取消
    private String subject;//食品拼接名称
    private String custEatTableId;//拼桌Id
    @Column(columnDefinition = "decimal(10,2)")
    private BigDecimal allBoMoney;//外带
    @Column(columnDefinition = "decimal(10,2)")
    private BigDecimal allCutleryMoney;//餐具费用

    private String reason;//退款理由
    private String otherOrderNumber;//第三方接口支付成功返回单号,回调使用
    private String tradeOrderNumber; //微信支付成功,回调返回的单号,退款使用
    private Integer useFoodNumber; //用餐人数
    private Integer supporyPayWay;//1.线上 2.线下
    private String customerVipCouponId;//用户使用优惠券Id
    @Column(columnDefinition = "decimal(10,2)")
    private BigDecimal discountMoney;//优惠金额
    @Column(columnDefinition = "decimal(10,2)")
    private BigDecimal actPayMoney;//实付金额

    //为了打印使用
    private Integer printType;//1.未打印 2.已打印
    //---------------本字段用户查询,不记入数据库-------------------
    @Transient
    private Date start_createTime;
    @Transient
    private Date end_createTime;
}
